package cn.datawin.bms.modules.provider.controller;

import cn.datawin.bms.modules.provider.service.ProvApiProgramTemplateService;
import cn.datawin.bms.provider.entity.ProvApiProgramTemplateEntity;
import cn.datawin.common.core.util.R;
import cn.datawin.common.log.annotation.SysLog;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ArrayUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pig4cloud.plugin.excel.annotation.ResponseExcel;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.http.HttpHeaders;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 上游供应商连接程序参数模板表
 *
 * @author datawin-sms
 * @date 2025-08-20 16:35:32
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/provider/apiProgramTemplate" )
@Tag(description = "provApiProgramTemplate" , name = "上游供应商连接程序参数模板表管理" )
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class ProvApiProgramTemplateController {

    private final ProvApiProgramTemplateService provApiProgramTemplateService;

    /**
     * 通过apiProgramId查询上游供应商连接程序参数模板表
     * @param apiProgramId 接入程序id
     * @return R
     */
    @Operation(summary = "通过apiProgramId查询上游供应商连接程序参数模板表" , description = "通过apiProgramId查询上游供应商连接程序参数模板表" )
    @GetMapping("/getListByApiProgramId/{apiProgramId}" )
	@PreAuthorize("isAuthenticated()")  // 只需要登录权限
    public R<List<ProvApiProgramTemplateEntity>> getListByApiProgramId(@PathVariable("apiProgramId" ) Long apiProgramId) {
        return R.ok(provApiProgramTemplateService.getListByApiProgramId(apiProgramId));
    }

}
